﻿
package extremefx.i18n {
	import extremefx.DateTime;
	import extremefx.i18n.EastAsianLunisolarCalendar;	
	/**
	 * @author Marcelo Volmaro
	 */
	public class JapaneseLunisolarCalendar extends EastAsianLunisolarCalendar {
//		private static const JAPANESE_ERA:uint = 1;
		private static const MIN:DateTime = new DateTime (1960, 1, 28, 0, 0, 0);
		private static const MAX:DateTime = new DateTime (2050, 1, 22, 23, 59, 59);
		
		//@TODO: JapaneseLunisolarCalendar
		public function JapaneseLunisolarCalendar() {
			super();
			_eraHandler.appendEra(3,
				CCGregorian._fixedFromDMY(25, 12, 1926),
				CCGregorian._fixedFromDMY(7, 1, 1989));
				
			_eraHandler.appendEra(4,
				CCGregorian._fixedFromDMY(8, 1, 1989));
		}
		
		protected override function get actualCurrentEra():int {
			return 4;
		}
		
		public override function get eras():Array {
			return _eraHandler.eras.concat();  
		}
		
		public override function getEra(pDate:DateTime):int {
			var rd:int = CCFixed._fromDateTime(pDate);
			var era:Array = [];
			_eraHandler.eraYear(era, rd);
			return int(era[0]);
		}
		
		public override function get minSupportedDateTime():DateTime {
			return MIN;
		}
		
		public override function get maxSupportedDateTime():DateTime {
			return MAX;
		}
		
		
	}
}
